home *** CD-ROM | disk | FTP | other *** search
/ DarkBASIC - The Ultimate 3D Game Creator / PCactive 8 CD1 - DarkBasic.iso / SOFTWARE / DEMOS / DarkForge2000 / snippets_vol3 / snip_verticaldistort.dba < prev    next >
Encoding:
Text File  |  2000-09-30  |  1.2 KB  |  61 lines

  1. `    ------------------------------------------------------------------------
  2. `    Vertical Distortion                        DarkForge Snippet (17/8/2000)
  3. `    ------------------------------------------------------------------------
  4. `    This sine-waves a 640x480 BMP but vertically, not horizontally!
  5.  
  6. sync rate 0
  7. sync on
  8. hide mouse
  9.  
  10. load bitmap "sanctuary_by_thomas.bmp",1
  11. create bitmap 2,640,480
  12.  
  13. set current bitmap 1
  14. for i=1 to 639
  15.     get image i,i,0,i+1,479
  16. next i
  17.  
  18. set text opaque
  19. ink rgb(255,255,255),0
  20.  
  21. `    Change these values to alter the distortion effect
  22. `    Uncomment a step line for a different style
  23.  
  24. `    Small waveform, slow, smooth
  25. `step=2 : sx=0 : speed=2
  26.  
  27. `    Typical demo effect speed/wave :)
  28. step=3 : sx=0 : speed=8
  29.  
  30. `    Lots of fast ripples!
  31. `step=8 : sx=0 : speed=4
  32.  
  33. `    One large fast ripple
  34. `step=2 : sx=0 : speed=16
  35.  
  36. do
  37.  
  38.     set current bitmap 2
  39.  
  40. `    The CLS is optional, if you comment it out you get a quite cool
  41. `    pixel-drag effect on the sides of the screen - try it and see!
  42.  
  43.     cls 0
  44.  
  45.     for i=1 to 639
  46.         paste image i,i,sin(sx+i*step)*25
  47.     next i
  48.  
  49.     inc sx,speed
  50.  
  51. `    Uncomment to show fps
  52. `    text 0,0,str$(screen fps())
  53.  
  54.     set current bitmap 0
  55.     copy bitmap 2,0
  56.  
  57.     sync
  58.  
  59. loop
  60.  
  61.